


		<?php $answers = $data->getAnswerForEdit($data->ID,Yii::app()->user->id);?>	
		<?php foreach ($answers as $a) {?>	
		<tr class="odd">
		
			<td style="width: 10%; text-align: center;">
				<a href="<?php echo Yii::app()->baseUrl."/admin/issue/view/id/".$a['issueID']?>"><?php echo $a['issueID']?></a>
			</td>
			
			<td style="width: 10%; text-align: center;">
				<a href="<?php echo Yii::app()->baseUrl."/admin/answer/view/id/".$a['ID']?>">Câu <?php echo $a['thread_number']?></a>
			</td>
			
			<?php					
					$edit_status = $data->getStatus('answer',$a['ID'],'edit_status');						 
			?>	
									
			<td style="width: 25%; text-align: center;"><?php echo $edit_status?></td>	
			
			<td style="width: 25%; text-align: center;"
				 id="countdown_<?php echo $a['ID'] ?>_<?php echo $a['issueID']?>" class="countdown">
				<?php echo ($a['expire_edit_time']-time())>=0?($a['expire_edit_time']-time()):"<button class='disabled btn btn-warning'><i class='icon-time icon-white'></i> Hết giờ</button>"?>				
			</td>
			
			<td style="width: 30%; text-align: center;">				
				<a style="width: 120px;" 
					href="javascript: showPopup('<?php echo Yii::app()->baseUrl?>/admin/answer/view/id/<?php echo $a['ID']?>',800,600)" class="btn btn-success" id="view_<?php echo $data->ID.'_'.$a['thread_number']?>">
					<i class="icon-eye-open icon-white" ></i>Xem bài giải
				</a>
				<?php if($a['edit_status']==41) {?>
					
							<a style="width: 120px;"
							 href="javascript: showPopup('<?php echo Yii::app()->baseUrl?>/admin/answer/update/id/<?php echo $a['ID']?>',800,600)" class="btn btn-primary" id="view_<?php echo $data->ID.'_'.$a['thread_number']?>">
							<i class="icon-pencil icon-white"></i> Soạn bài giải
							</a>
					
				<?php } else {?>
					
							<a style="width: 120px;"
							 href="javascript: showPopup('<?php echo Yii::app()->baseUrl?>/admin/answer/update/id/<?php echo $a['ID']?>',800,600)" class="btn btn-info" id="view_<?php echo $data->ID.'_'.$a['thread_number']?>">
							<i class="icon-edit icon-white"></i> Update bài giải
							</a>
					
				<?php }?>				
			</td>
		</tr>
	<?php }?>




